Skip to content

fix: ensure that Cypress.stop fires all end events appropriately #31780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from

Conversation

ryanthemanuel
Copy link
Collaborator

@ryanthemanuel ryanthemanuel commented May 23, 2025

Additional details

  • Moved our abort logic until after the test:after:run:async event is sent. This will guarantee that the necessary events are received before the run is aborted.

Steps to test

  • Add the following listeners:
  Cypress.on('test:before:after:run:async', async () => {
    await new Promise(resolve => setTimeout(resolve, 20000))
  })
  • Run a test that use Cypress.stop()
  • Verify the Test Replay displays properly

How has the user experience changed?

Test Replay is now available for all tests when Cypress.stop() is used.

PR Tasks

@ryanthemanuel ryanthemanuel self-assigned this May 23, 2025
Copy link

cypress bot commented May 23, 2025

cypress    Run #62877

Run Properties:  status check passed Passed #62877  •  git commit 4be318af96: update changelog
Project cypress
Branch Review ryanm/fix/attempt-to-fix-Cypress.stop
Run status status check passed Passed #62877
Run duration 18m 46s
Commit git commit 4be318af96: update changelog
Committer Matthew Schile
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 13
Tests that did not run due to a developer annotating a test with .skip  Pending 1232
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 32182
View all changes introduced in this branch ↗︎
UI Coverage  45.96%
  Untested elements 189  
  Tested elements 165  
Accessibility  92.73%
  Failed rules  3 critical   9 serious   2 moderate   2 minor
  Failed elements 698  

@mschile mschile closed this Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cypress.stop() does not always fire test:after:run:async events
2 participants